<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Load layer as item</title>

<style>
html, body {
  margin: 0;
  padding: 0;
}

</style>

<link rel="stylesheet" href="https://jsdev.arcgis.com/4.0beta3/esri/css/main.css">
<script src="https://jsdev.arcgis.com/4.0beta3/"></script>

<script>
require([
  "esri/Map",
  "esri/views/MapView",
  "esri/portal/PortalItem",
  "esri/layers/FeatureLayer",
  "dojo/domReady!"
], function(
  Map, MapView, PortalItem, FeatureLayer
) {
    
  var map = new Map({
    basemap: "gray"
  });

  var view = new MapView({
    map: map,
    container: "viewDiv",
    center: [-100, 40],
    zoom: 5
  });
    
  /****************************************
  * Create FeatureLayer from portal item ID
  *****************************************/
    
  var lyr = new FeatureLayer({
    portalItem: new PortalItem({
      id: "fbe2f59bb9f445f0a01ffe062b40b741"   
    })
  });

  map.add(lyr);
});
</script>
</head>

<body>
  <div id="viewDiv"></div>
</body>

</html>